Pug View Engine – Iteration
Pug is a template engine for NodeJS and browsers to render dynamic reusable content. At compile time, the template engine compiles our Pug template code to HTML. Pug has many powerful features like conditions, loops, includes, and mixins using which we can render HTML code based on user input or reference data....
read more
How to Configure multiple View Engines in Express.js ?
View engines present in web application framework are basically the template engines that allow us to embed dynamic content into the web pages, render them on the server, and send them to the client. With the help of these, we can serve dynamic data, and utilise the template inheritance properties to server our web pages, quickly and efficiently....
read more
Filters in Pug View Engine
Pug is a template engine that can be used to create HTML documents. It’s used to write templates that are then compiled into functions that take in data and render HTML documents....
read more
Elements in Pug View Engine
Pug is a template engine that works with JavaScript libraries and frameworks. It simplifies the process of writing HTML by reducing traditional HTML syntax. It uses indentation to represent HTML structure. By using Pug you can reuse the HTML code....
read more
Plain Text in Pug View Engine
Plain text in Pug can be retrieved via a variety of methods, each with its own syntax and advantages. This article will go over many strategies for achieving plain text output in Pug, outlining each approach step by step. We’ll also include examples, installation instructions for required modules, package.json dependency updates, and resources for further learning....
read more
Pug View Engine Installation
Pug, once known as Jade, makes writing HTML codes e­asy for NodeJS and web browsers. It’s cle­ar syntax and handy features spee­d up web work and keep things simple­. This quick guide will go over what you nee­d to use Pug, how to install it, and what it does, and will give you cle­ar steps along with examples to cre­ate your first application using Pug....
read more
Doctype in Pug View Engine
In web development, the­ term “doctype” stands for Document Type­ Declaration. It’s a key part, of defining the­ document type and telling the­ browser how to use it....
read more
Template Inheritance: Extend and Block in Pug
While creating websites or different web applications, we can first create a base HTML template, and build different pages on top of the base template. This concept of using building pages over a base template is called Template Inheritance. It’s a powerful feature available in web template engines like Pug. We can use template inheritance in Pug using “extend” or “block”....
read more
How to pass a Node.js variable to the inside of a Pug script tag ?
In Node.js with Pug, we can pass the variables to the Pug template engine using the res.render method. To make the variable available inside the Pug script tag, we include it in the object passed to res.render and then reference it within the Pug file using the syntax “#{variableName}” inside the script tag....
read more
How to create Lists in Pug View Engine ?
Pug is a template engine for NodeJS and browsers to render dynamic reusable content. At compile time, the template engine compiles our Pug template code to HTML. Pug has many powerful features like conditions, loops, includes, and mixins using which we can render HTML code based on user input or reference data....
read more
How to run pug View Engine using Express?
Pug or Jade is the template engine for NodeJS and browsers that are used for the process of developing dynamic HTML content. This template engine uses the indentation-based syntax like Python to generate the HTML markup, which makes it simpler to write and also to maintain the code. If we want to run the Pug, we need to install it using the npm (Node Package Manager) and then use the command to integrate it into the NodeJS application to render the Pug template into HTML. In this article, we will go through the detailed step-by-step process to run Pug....
read more
Pug View Engine Introduction
Pug is a template engine that works with JavaScript libraries and frameworks. It simplifies the process of writing HTML by reducing traditional HTML syntax. It uses indentation to represent HTML structure. By using Pug you can reuse the HTML code. In this article, we will learn about how to use pug and its syntax examples....
read more